<script src="<?php echo base_url('assets/js/timePicker/js/bootstrap-datetimepicker.min.js') ?>"></script>
<script src="<?php echo base_url('assets/js/bandasHorarias.js') ?>"></script>
<link href="<?php echo base_url('assets/js/timePicker/css/bootstrap-datetimepicker.min.css') ?>" rel="stylesheet">

<fieldset>


    <legend>Bandas Horarias</legend>

    <?php
    if (isset($bandasHorarias) && !empty($bandasHorarias)) {
        foreach ($bandasHorarias as $bandaHoraria) {
            ?>
    <form class="form-horizontal" method="POST" action="<?php echo base_url('index.php/profesores/updateBandaHoraria/'.$bandaHoraria->id); ?>">
                <input type="hidden" name="profesorId" value="<?php echo $bandaHoraria->profesor ?>" />
                <div class="control-group">
                    <label class="control-label" for="carrera">Día:</label>
                    <div class="controls">
                        <select id="dia" name="dia" class="input-xlarge">
                            <?php
                            foreach ($dias as $row) {
                                ?>
                                <option value="<?php echo $row->id; ?>" <?php echo ($bandaHoraria->dia == $row->id)?'SELECTED="SELECTED"':'';?> > 
                                    <?php echo $row->dia; ?></option>

                                <?php
                            }
                            ?>
                        </select>
                    </div>
                </div>
                <div class="control-group"> 
                    <label class="control-label" for="carrera">Desde:</label>
                    <div id="datetimepickerDesde" class="input-append controls time" style="margin-left: 20px;">
                        <input data-format="hh:mm:ss" type="text" name="desde" value="<?php echo $bandaHoraria->desde;?>"></input>
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar">
                            </i>
                        </span>
                    </div>
                </div>
                <div class="control-group"> 
                    <label class="control-label" for="carrera">Hasta:</label>
                    <div id="datetimepickerHasta" class="input-append controls time" style="margin-left: 20px;">
                        <input data-format="hh:mm:ss" type="text" name="hasta" value="<?php echo $bandaHoraria->hasta;?>"></input>
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar">
                            </i>
                        </span>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="send"></label>
                    <div class="controls">                        
                        <button id="send" name="send" value="update" type="submit" class="btn btn-info">Modificar</button>
                        <button id="send" name="send" value="delete" class="btn btn-danger">Eliminar</button>
                    </div>
                    
                </div>
                
            </form>
            <?php
        }
    }
    ?>


</fieldset>

<fieldset><legend>Nueva Banda Horaria</legend>
    <form class="form-horizontal" method="POST" action="<?php echo base_url('index.php/profesores/createBandaHoraria/'.$profesorId); ?>">
        <input type="hidden" name="profesorId" value="<?php echo $profesorId ?>" />
        <div class="control-group">
            <label class="control-label" for="carrera">Día:</label>
            <div class="controls">
                <select id="dia" name="dia" class="input-xlarge">
                    <?php
                    foreach ($dias as $row) {
                        ?>
                        <option value="<?php echo $row->id; ?>" selected="">
                            <?php echo $row->dia; ?></option>

                        <?php
                    }
                    ?>
                </select>
            </div>
        </div>
        <div class="control-group"> 
            <label class="control-label" for="carrera">Desde:</label>
            <div id="datetimepickerDesde" class="input-append controls time" style="margin-left: 20px;">
                <input data-format="hh:mm:ss" type="text" name="desde"></input>
                <span class="add-on">
                    <i data-time-icon="icon-time" data-date-icon="icon-calendar">
                    </i>
                </span>
            </div>
        </div>
        <div class="control-group"> 
            <label class="control-label" for="carrera">Hasta:</label>
            <div id="datetimepickerHasta" class="input-append controls time" style="margin-left: 20px;">
                <input data-format="hh:mm:ss" type="text" name="hasta"></input>
                <span class="add-on">
                    <i data-time-icon="icon-time" data-date-icon="icon-calendar">
                    </i>
                </span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="send"></label>
            <div class="controls">
                <button id="send" name="send" class="btn btn-success">Crear</button>
            </div>
        </div>
    </form>
</fieldset>
